<template>
  <h1>网上h1组件</h1>
  <h2>{{name}}</h2>
  <h2>{{age}}</h2>
  <h2>{{job.type}}</h2>
  <h2>{{job.salary}}</h2>
  <button @click="hello">测试</button>
  <button @click="update">修改一个人的信息</button>
</template>

<script>
import { ref } from '@vue/reactivity';
//import {h} from 'vue'
export default {
  
  name: 'App',
  setup() {
    let name=ref('张三');
    let age=ref(18);
    let job=ref({
      type:'程序员',
      salary:'123'
    })

    function hello(){
       alert(`我叫${name}年龄${age}`)
    }
    function update(){
      name.value="456",
      age.value=19,
      job.value.type='489',
      job.value.salary='258'

    }
    return{
      name,age,hello,update,job
    }
    //返回渲染函数
   // return()=> h('h1','123')
    
  }
}
</script>


